﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using N2.Details;
using N2.Integrity;
using N2;
using FlexiCommerce.Web.Templates;

namespace FlexiCommerce.Web.Addons.FC.Items
{
    [Definition("Category Data","CategoryData")]
    [AllowedZones(Zones.Left, Zones.Right, Zones.Content)]
    [RestrictParents(Types=new Type[] {typeof(CategoryPage)})]
    public class CategoryDataItem : AbstractDataBoundStoreItem
    {
        protected override string TemplateName
        {
            get
            {
                return "CategoryData";
            }
        }

        [EditableFreeTextArea("Content",0)]
        public string Content
        {
            get { return GetDetail<string>("Content", ""); }
            set { SetDetail<string>("Content", value, ""); }
        }

        public override bool DoesDataBoundItemExist()
        {
            return (FlexiCommerce.Context.CurrentCategory != null);
        }
    }
}
